import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';

import 'mslocator_platform_interface.dart';

/// An implementation of [MslocatorPlatform] that uses method channels.
class MethodChannelMslocator extends MslocatorPlatform {
  /// The method channel used to interact with the native platform.
  @visibleForTesting
  final methodChannel = const MethodChannel('mslocator');

  @override
  Future<String?> getPlatformVersion() async {
    final version =
        await methodChannel.invokeMethod<String>('getPlatformVersion');
    return version;
  }

  @override
  Future<String?> getLastKnownPosition() async {
    final data =
        await methodChannel.invokeMethod<String>('getLastKnownPosition');
    return data;
  }

  @override
  Future<bool?> checkLocationService() async {
    final data =
    await methodChannel.invokeMethod<bool>('checkLocationService');
    return data;
  }
}
